package client

import (
	"3-19yk/common/proto/user"
	"context"
)

func EsSync(ctx context.Context, req *user.EsSyncReq) (*user.EsSyncResp, error) {
	client, err := UserClient(ctx, func(ctx context.Context, client user.UserClient) (interface{}, error) {
		login, err := client.EsSync(ctx, req)
		if err != nil {
			return nil, err
		}
		return login, nil
	})
	if err != nil {
		return nil, err
	}
	return client.(*user.EsSyncResp), nil
}
func EsSear(ctx context.Context, req *user.EsSearReq) (*user.EsSearResp, error) {
	client, err := UserClient(ctx, func(ctx context.Context, client user.UserClient) (interface{}, error) {
		login, err := client.EsSear(ctx, req)
		if err != nil {
			return nil, err
		}
		return login, nil
	})
	if err != nil {
		return nil, err
	}
	return client.(*user.EsSearResp), nil
}
func ScenicShow(ctx context.Context, req *user.ScenicShowReq) (*user.ScenicShowResp, error) {
	client, err := UserClient(ctx, func(ctx context.Context, client user.UserClient) (interface{}, error) {
		login, err := client.ScenicShow(ctx, req)
		if err != nil {
			return nil, err
		}
		return login, nil
	})
	if err != nil {
		return nil, err
	}
	return client.(*user.ScenicShowResp), nil
}
